﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Login</title>
    <script src="~/scripts/jquery.js"></script>
    <script src="~/scripts/jquery.validate.js"></script>
</head>
<body>
    <div>
        @using (Html.BeginForm())
        {
        <p>用户名:@Html.TextBox("username", "", new { @id = "username" })</p>
        <p>密码:@Html.Password("userpwd", "", new { @id = "userpwd" })</p>
        <p>确认密码:@Html.Password("userpwds", "", new { @id = "userpwds" })</p>
        <button type="submit">提交</button>
        }
    </div>
    <script>
        $(document).ready(Function(){
            $("form").validate({
                rules: {
                    username: { required: true },
                    userpwd: { required: true },
                    userpwds: { required: true, equalTo: "#userpwd" },
                },
                messages: {
                    username: { required: "请输入用户名" }
                    userpwd: { required: "请输入密码" }
                    userpwds: { required: "请输入用密码",equalTo:"两次密码输入不一致" }
                }
            })
        })
    </script>
</body>
</html>
